package com.ss.android.article.base.feature.detail2.a.c;

import android.content.Context;
import android.content.res.Resources;
import android.widget.TextView;
import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.base.feature.detail2.widget.a.BaseDetailLayout;
import com.ss.android.article.base.ui.EllipsisTextView;
import com.ss.android.article.browser.R;
import com.ss.android.article.common.NightModeAsyncImageView;
import org.json.JSONObject;

public final class DetailAdMediaLayout extends BaseDetailLayout {
    public NightModeAsyncImageView adMediaPicIv;
    public TextView adMediaTitleTv;
    public EllipsisTextView adMediaContentTv;
    public JSONObject jsonObject;
    private TextView adMediaLabelTv;

    public DetailAdMediaLayout(Context arg1) {
        super(arg1);
    }

    public final void initView() {
        super.initView();
        int dp125 = ((int) UIUtils.dp2px(this.getContext(), 12.5f));
        this.setPadding(dp125, dp125, dp125, dp125);
        this.adMediaPicIv = this.findViewById(com.ss.android.article.browser.R.id.ad_media_pic);
        this.adMediaTitleTv = this.findViewById(com.ss.android.article.browser.R.id.ad_media_title);
        this.adMediaLabelTv = this.findViewById(com.ss.android.article.browser.R.id.ad_media_label);
        this.adMediaContentTv = this.findViewById(com.ss.android.article.browser.R.id.ad_media_content);
    }

    public final void adaptNightMode(boolean isNightMode) {
        super.adaptNightMode(isNightMode);
        Resources resources = this.getResources();
        this.adMediaPicIv.adaptNightMode(isNightMode);
        this.adMediaTitleTv.setTextColor(resources.getColorStateList(com.ss.android.article.browser.R.color.ssxinzi1));
        this.adMediaLabelTv.setTextColor(resources.getColorStateList(com.ss.android.article.browser.R.color.ssxinzi5));
        this.adMediaContentTv.setTextColor(resources.getColorStateList(com.ss.android.article.browser.R.color.ssxinzi3));
        this.adMediaLabelTv.setBackgroundResource(com.ss.android.article.browser.R.drawable.detail_ad_media_tuiguang);
        this.setBackgroundResource(com.ss.android.article.browser.R.drawable.detail_ad_bg);
    }

    public final int getLayoutRes() {
        return R.layout.new_detail_ad_media;
    }
}

